(custom-set-variables
 ;; custom-set-variables was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 '(ecb-primary-secondary-mouse-buttons (quote mouse-1--mouse-2))
 '(inhibit-startup-screen t))
(custom-set-faces
 ;; custom-set-faces was added by Custom.
 ;; If you edit it by hand, you could mess it up, so be careful.
 ;; Your init file should contain only one such instance.
 ;; If there is more than one, they won't work right.
 )
;;add plugin path
(add-to-list 'load-path "~/.emacs.d/plugins/auto-complete-1.3.1")
(add-to-list 'load-path "~/.emacs.d/plugins/yasnippet-0.8.0")
(add-to-list 'load-path "~/.emacs.d/plugins/cedet-1.1/common")
(add-to-list 'load-path "~/.emacs.d/plugins/cedet-1.1/speedbar")
(add-to-list 'load-path "~/.emacs.d/plugins/cedet-1.1/eieio")
(add-to-list 'load-path "~/.emacs.d/plugins/cedet-1.1/semantic")
(add-to-list 'load-path "~/.emacs.d/plugins/ecb-2.40")
(add-to-list 'load-path "~/.emacs.d/plugins/gtags")
(add-to-list 'load-path "~/.emacs.d/plugins/tabbar")

;;none backup
(setq make-backup-file nil)

;;yes or no
(fset 'yes-or-no-p 'y-or-n-p) 

;;Disable toolbar
(tool-bar-mode 0)

;;Disable menu bar
(menu-bar-mode 0)

;;Disable scroll-bar
(scroll-bar-mode 0)

;;Disable startup
(setq inhibit-startup-message t)

;;size
(setq initial-frame-alist '((width.150) (height.90)))

;;mode
(setq default-major-mode 'text-mode)

;;cursor color
(set-cursor-color "white")
;;mouse color
(set-mouse-color "blue")
;;foregroud and background color
(set-foreground-color "lightblue")
(set-background-color "black")
(set-border-color "lightgreen")

;;syntx hightlight
(set-face-foreground 'highlight "red")
(set-face-background 'highlight "blud")
(set-face-foreground 'region "cyan")
(set-face-background 'region "blue")
(set-face-foreground 'secondary-selection "skyblue")
(set-face-background 'secondary-selection "darkblue")
(global-font-lock-mode t)
(transient-mark-mode t)

;;font
(set-default-font "Monaco")

;;display time
(display-time-mode 1)
(setq display-time-24hr-format t) 
(setq display-time-day-and-date t) 

;;toolbar
(tool-bar-mode nil)

;;set buffer name
(setq frame-title-format '("" buffer-file-name "@%b" ))

;;scroll-margin
(setq scroll-margin 5 scroll-conservatively 10000)

;;highlight param
(show-paren-mode t)
(setq show-paren-style 'parentheses)

;;mouse avoidance
(mouse-avoidance-mode 'animate)

;;past to **
(setq mouse-yank-at-point t)

;;line number
(require 'linum)
(setq linum-format "%3d")
(add-hook 'find-file-hooks (lambda()(linum-mode 1)))

;;key binding
(global-set-key [f1] 'shell)
(global-set-key [f8] 'goto-line)

;;maximum window
(defun my-maximized ()
  (interactive)
  (x-send-client-message
   nil 0 nil "_NET_WM_STATE" 32
   '(2 "_NET_WM_STATE_MAXIMIZED_HORZ" 0)
   )
  (x-send-client-message
   nil 0 nil "_NET_WM_STATE" 32
   '(2 "_NET_WM_STATE_MAXIMIZED_VERT" 0)
   )
  )
(my-maximized)

;;****************plugins**************
;;yasnippet
(require 'yasnippet)
(yas-global-mode 1)
;;auto-complete
(require 'auto-complete)
(require 'auto-complete-config)
(add-to-list 'ac-dictionary-directories "~/.emacs.d/plugins/auto-complete-1.3.1/dict")
(ac-config-default)

;;cedet ecb
(require 'cedet)
(require 'semantic-ia)

(global-ede-mode 1)
(global-srecode-minor-mode 1)
(semantic-load-enable-code-helpers)

(require 'ecb)
(setq stack-trace-on-error t)
(setq ecb-auto-activate t
      ecb-tip-of-the-day nil
      ecb-tree-indent 4 
      ecb-windows-height 0.5 
      ecb-windows-width 0.15 
      ecb-auto-compatibility-check nil 
      ecb-version-check nil) 
;;(global-set-key [M-left] 'windmove-left)
;;(global-set-key [M-right] 'windmove-right)
;;(global-set-key [M-up] 'windmove-up)
;;(global-set-key [M-down] 'windmove-down)

;;code folding
(require 'semantic-tag-folding nil 'noerror)  
(global-semantic-tag-folding-mode 1)
(global-set-key (kbd "M-q") 'semantic-ia-complete-symbol-menu)
(define-key semantic-tag-folding-mode-map (kbd "C--") 'semantic-tag-folding-fold-block)
(define-key semantic-tag-folding-mode-map (kbd "C-=") 'semantic-tag-folding-show-block)
(define-key semantic-tag-folding-mode-map (kbd "C-_") 'semantic-tag-folding-fold-all)
(define-key semantic-tag-folding-mode-map (kbd "C-+") 'semantic-tag-folding-show-all)
;;(setq outline-minor-mode-prefix (kbd "C-o"))

;;gtags
(require 'gtags)

;;tabbar
(require 'tabbar)
(tabbar-mode 1)
(global-set-key [M-left] 'tabbar-backward-tab)
(global-set-key [M-right] 'tabbar-forward-tab)
